﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Excel = Microsoft.Office.Interop.Excel;
using System.Data;
using ZLDC.Topo.BLL.Estate;
using ZLDC.Common.Estate;
namespace ZLDC.Estate.Quantify.Report
{
    public partial class lp_Share : System.Web.UI.Page
    {
        protected string Alter = string.Empty;
        protected int ii = 0;
        protected string Alter2 = string.Empty;
        public string depttype;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                iStartDay.Value = DateTime.Now.AddMonths(-1).ToString("yyyy-MM");
                iEndDay.Value = DateTime.Now.AddMonths(-1).ToString("yyyy-MM");
               
                 depttype = ZLDC.Topo.BLL.Estate.lp_Report_list.GetType(_Utility.GetInfoBySession().m_sDeptID);//获取部门类型
                 LoadCity2();
            }
        }
       
       
        protected void Button2_Click(object sender, EventArgs e)
        {
            //ZLDC.Topo.BLL.Estate.lp_Share.GetExcel(Page, iStartDay, iEndDay, txtename, txtDistrict, txtDepartment, _Utility.GetInfoBySession().m_sDeptName);
        }
        /// <summary>
        /// 加载城区
        /// </summary>
        private void LoadCity2()
        {
            string sql = "";
            //switch(depttype)
            //{
            //    case "后勤":
            //        sql = "select * from t_zlhq_t_s_alldept where type='营业部' and DltFlg=0 and  fgs='深圳'";
            //        ZLDC.Topo.BLL.Estate.lp_Basis.droplist(sCity2, "name", "id", sql);
            //        sCity2.Disabled = true;
            //        break;
            //    case "营业大部":
            //        sql = "select * from t_zlhq_t_s_alldept where type='营业部' and DltFlg=0 and  fgs='" + _Utility.GetInfoBySession().m_sFgs + "'";
            //        sCity2.Disabled = true;
            //        break;
            //    case "营业部":
            //        sql = "select * from t_zlhq_t_s_alldept where type='营业部' and DltFlg=0 and  fgs='" + _Utility.GetInfoBySession().m_sFgs + "'";
            //        break;
            //    case "区域":
            //        //sql = "select * from t_zlhq_t_s_alldept where type='区域' and DltFlg=0 and  fgs='" + _Utility.GetInfoBySession().m_sFgs + "'";
            //        sCity2.Disabled = true;
            //        break;
            //    case "分行":
            //        sql = "select * from t_zlhq_t_s_alldept where type='区域' and DltFlg=0 and  fgs='" + _Utility.GetInfoBySession().m_sFgs + "'";
            //        break;
            //}
            sql = "select * from t_zlhq_t_s_alldept where type='营业部' and DltFlg=0 and  fgs='深圳'";
            ZLDC.Topo.BLL.Estate.lp_Basis.droplist(sCity2, "name", "id", sql);
            //ZLDC.Topo.BLL.Estate.AreaBLL.LoadCity(sCity2, 1);
            //ListItem item1 = new ListItem("全部", "0");
            //sCity2.Items.Insert(0, item1);
        }
    }
}
